<?php
// src/Acme/StoreBundle/Entity/Product.php
namespace Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="purchases")
 */
class Purchase {
    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;
    
    /**
     * @ORM\Column(type="smallint")
     */
    protected $status;
    
    /**
     * @ORM\Column(type="smallint")
     */
    protected $gpsType;
    
    /**
     * @ORM\Column(type="string", length=256)
     */
    protected $gpsAcct;
    
    /**
     * @ORM\Column(type="string", length=256)
     */
    protected $gpsPass;
    
    /**
     * @ORM\Column(type="smallint")
     */
    protected $refType;
    
    /**
     * @ORM\Column(type="string", length=256)
     */
    protected $refAcct;
    
    /**
     * @ORM\ManyToOne(targetEntity="User", inversedBy="purchases")
     **/
    protected $owner;
    
    /**
     * @ORM\Column(type="float")
     */
    protected $lastLat;
    
    /**
     * @ORM\Column(type="float")
     */
    protected $lastLng;
    
    /**
     * @ORM\Column(type="float")
     */
    protected $lastDist;
    
    /**
     * @ORM\Column(type="datetime")
     */
    protected $lastCheckIn;
    
    /**
     * @ORM\Column(type="datetime")
     */
    protected $wakeUpTime;
    
    /**
     * @ORM\OneToMany(targetEntity="PurchaseRecord", mappedBy="owner")
     **/
    protected $records;
    
    /**
     * @ORM\OneToMany(targetEntity="PurchaseDairy", mappedBy="owner")
     **/
    protected $dailies;

    public function __construct()
    {
        $this->status = 0;
        $this->gpsType = 1;
        $this->refType = 0;
        $this->refAcct = '';
        $this->lastLat = '';
        $this->lastLng = '';
        $this->lastCheckIn = '00-00-00 00:00:00';
        $this->wakeUpTime = '00-00-00 00:00:00';
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }
    
    /**
     * Set ref_type
     *
     * @param integer $refType
     * @return Purchase
     */
    public function setRefType($refType)
    {
        $this->ref_type = $refType;
    
        return $this;
    }

    /**
     * Get ref_type
     *
     * @return integer 
     */
    public function getRefType()
    {
        return $this->ref_type;
    }

    /**
     * Set ref_acct
     *
     * @param string $refAcct
     * @return Purchase
     */
    public function setRefAcct($refAcct)
    {
        $this->ref_acct = $refAcct;
    
        return $this;
    }

    /**
     * Get ref_acct
     *
     * @return string 
     */
    public function getRefAcct()
    {
        return $this->ref_acct;
    }

    /**
     * Set owner
     *
     * @param \Entity\User $owner
     * @return Purchase
     */
    public function setOwner(\Entity\User $owner = null)
    {
        $this->owner = $owner;
    
        return $this;
    }

    /**
     * Get owner
     *
     * @return \Entity\User 
     */
    public function getOwner()
    {
        return $this->owner;
    }

    /**
     * Set status
     *
     * @param integer $status
     * @return Purchase
     */
    public function setStatus($status)
    {
        $this->status = $status;
    
        return $this;
    }

    /**
     * Get status
     *
     * @return integer 
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Set gpsType
     *
     * @param integer $gpsType
     * @return Purchase
     */
    public function setGpsType($gpsType)
    {
        $this->gpsType = $gpsType;
    
        return $this;
    }

    /**
     * Get gpsType
     *
     * @return integer 
     */
    public function getGpsType()
    {
        return $this->gpsType;
    }

    /**
     * Set gpsAcct
     *
     * @param string $gpsAcct
     * @return Purchase
     */
    public function setGpsAcct($gpsAcct)
    {
        $this->gpsAcct = $gpsAcct;
    
        return $this;
    }

    /**
     * Get gpsAcct
     *
     * @return string 
     */
    public function getGpsAcct()
    {
        return $this->gpsAcct;
    }

    /**
     * Set gpsPass
     *
     * @param string $gpsPass
     * @return Purchase
     */
    public function setGpsPass($gpsPass)
    {
        $this->gpsPass = $gpsPass;
    
        return $this;
    }

    /**
     * Get gpsPass
     *
     * @return string 
     */
    public function getGpsPass()
    {
        return $this->gpsPass;
    }

    /**
     * Add records
     *
     * @param \Entity\PurchaseRecord $records
     * @return Purchase
     */
    public function addRecord(\Entity\PurchaseRecord $records)
    {
        $this->records[] = $records;
    
        return $this;
    }

    /**
     * Remove records
     *
     * @param \Entity\PurchaseRecord $records
     */
    public function removeRecord(\Entity\PurchaseRecord $records)
    {
        $this->records->removeElement($records);
    }

    /**
     * Get records
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getRecords()
    {
        return $this->records;
    }

    /**
     * Set lastLat
     *
     * @param float $lastLat
     * @return Purchase
     */
    public function setLastLat($lastLat)
    {
        $this->lastLat = $lastLat;
    
        return $this;
    }

    /**
     * Get lastLat
     *
     * @return float 
     */
    public function getLastLat()
    {
        return $this->lastLat;
    }

    /**
     * Set lastLng
     *
     * @param float $lastLng
     * @return Purchase
     */
    public function setLastLng($lastLng)
    {
        $this->lastLng = $lastLng;
    
        return $this;
    }

    /**
     * Get lastLng
     *
     * @return float 
     */
    public function getLastLng()
    {
        return $this->lastLng;
    }

    /**
     * Set lastDist
     *
     * @param float $lastDist
     * @return Purchase
     */
    public function setLastDist($lastDist)
    {
        $this->lastDist = $lastDist;
    
        return $this;
    }

    /**
     * Get lastDist
     *
     * @return float 
     */
    public function getLastDist()
    {
        return $this->lastDist;
    }

    /**
     * Set wakeUpTime
     *
     * @param \DateTime $wakeUpTime
     * @return Purchase
     */
    public function setWakeUpTime($wakeUpTime)
    {
        $this->wakeUpTime = $wakeUpTime;
    
        return $this;
    }

    /**
     * Get wakeUpTime
     *
     * @return \DateTime 
     */
    public function getWakeUpTime()
    {
        return $this->wakeUpTime;
    }

    /**
     * Set lastCheckIn
     *
     * @param \DateTime $lastCheckIn
     * @return Purchase
     */
    public function setLastCheckIn($lastCheckIn)
    {
        $this->lastCheckIn = $lastCheckIn;
    
        return $this;
    }

    /**
     * Get lastCheckIn
     *
     * @return \DateTime 
     */
    public function getLastCheckIn()
    {
        return $this->lastCheckIn;
    }

    /**
     * Add dailies
     *
     * @param \Entity\PurchaseDaily $dailies
     * @return Purchase
     */
    public function addDailie(\Entity\PurchaseDaily $dailies)
    {
        $this->dailies[] = $dailies;
    
        return $this;
    }

    /**
     * Remove dailies
     *
     * @param \Entity\PurchaseDaily $dailies
     */
    public function removeDailie(\Entity\PurchaseDaily $dailies)
    {
        $this->dailies->removeElement($dailies);
    }

    /**
     * Get dailies
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getDailies()
    {
        return $this->dailies;
    }
}